How to modify the categories?

The appearance (i.e. text color, icons) of the events is defined by the categories. At the moment the only way to change or add new categories is to edit the skins manually. The following text applies to the Shadow4 skin that comes with Rainlendar2 but the instructions should be similar with other skins too.

Important! If you make modifications to the default skin you should save it with a different name. Otherwise it will be overwritten when you upgrade Rainlendar to a newer version.

First thing you should do is to decompress the skin. Change the extension of the skin file from .r2skin to .zip and open the archive. Extract the contents of the archive to some temporary folder. You can also extract the skin to the Rainlendar's skins folder if you want to try it without the need to zip it up again.

The archive should contain a file called skin.xml and couple of subfolders. in the xml subfolder you can find a file called elements.xml. Open the file with a text editor.

The bitmapfont elements that are in the beginning of the file define the different variations of the image fonts that are used to draw the events on the calendar. You can only use the items defined in here. You can create new color variations with your favorite paint program if you want. Just make sure that the alpha channel is preserved when you save the png file. If you add new characters to the image you need to add them to the alphabet attribute too. Also make sure that the image's height (or width) is divisible with the number of characters in the image.

The next elements in the list are the icons that the categories use. You can create new icons too if you like. Just create the png files, put them to the images folder and add the filenames to the list.

The rest of the elements are the fonts and various images used in various places of the skin windows. You can ignore them for now so just scroll past them to the categories.

A category consists of the id attribute which identifies it and one or more appearance elements. The id is the same string what is used as the event category. The appearance defines how the category is shown in different windows. If the event has multiple categories the appearances are combined.

If you are using a localized version or Rainlendar the list that is shown in the user interface is localized too. However the category names are translated back to English before they are compared with the category ids in the skin so when creating a localized versions of the skins it's not necessary to translate the categories in the skin files. This naturally applies only to the category names that have a translation in Rainlendar's language file.

You can get details about the appearance element from the skin format reference. The important attributes are target, which defines the windows where the appearance is used, the layer and priority, which define how the appearances are handled when there are several events on the same day, and element, which refers to the graphical element that is shown in the windows.

If you want to change the color of the numbers in the calendar for some category you can just change the element attribute to use a different bitmapfont. Note that you can only use the elements that are defined in the top part of the xml file. If the category has only a icon but not the number you can copy the appearance from some other category.

Changing the icons is similar process as changing the numbers. The icons need showalways="1" in the appearance so that if there are multiple events on the same day the icons get tiled. Otherwise Rainlendar would show only the icon from the category which has the highest priority.

You can create new categories by copy-pasting an existing category definition and changing the id attribute. You should note that changing the id of a category not add it to the Rainlendar's list of categories. You need to also add it to the list of default categories in Rainlendar's advanced options.

After you have made the modifications to the skin just zip it again and change the extension back to .r2skin. Note that when you create the zip from the make sure that there is no extra folder in the archive. The skin.xml file must be in the root of the archive or the skin doesn't work.